{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Sorting & Ranking in Pandas"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Hi Guys, Welcome to [Tirendaz Academy](https://youtube.com/c/tirendazacademy) 😀\n",
    "</br>\n",
    "In this notebook, I'm going to show sorting & ranking in Pandas.\n",
    "</br>\n",
    "Happy Learning 🐱‍🏍 "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [],
   "source": [
    "import pandas as pd\n",
    "import numpy as np"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "e    0\n",
       "d    1\n",
       "a    2\n",
       "b    3\n",
       "c    4\n",
       "dtype: int64"
      ]
     },
     "execution_count": 2,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "s=pd.Series(range(5),\n",
    "            index=[\"e\",\"d\",\"a\",\"b\",\"c\"])\n",
    "s"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "a    2\n",
       "b    3\n",
       "c    4\n",
       "d    1\n",
       "e    0\n",
       "dtype: int64"
      ]
     },
     "execution_count": 3,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "s.sort_index()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>d</th>\n",
       "      <th>a</th>\n",
       "      <th>b</th>\n",
       "      <th>c</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>two</th>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>2</td>\n",
       "      <td>3</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>one</th>\n",
       "      <td>4</td>\n",
       "      <td>5</td>\n",
       "      <td>6</td>\n",
       "      <td>7</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>three</th>\n",
       "      <td>8</td>\n",
       "      <td>9</td>\n",
       "      <td>10</td>\n",
       "      <td>11</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "       d  a   b   c\n",
       "two    0  1   2   3\n",
       "one    4  5   6   7\n",
       "three  8  9  10  11"
      ]
     },
     "execution_count": 4,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df=pd.DataFrame(\n",
    "    np.arange(12).reshape(3,4),\n",
    "    index=[\"two\",\"one\",\"three\"],\n",
    "    columns=[\"d\",\"a\",\"b\",\"c\"])\n",
    "df"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>d</th>\n",
       "      <th>a</th>\n",
       "      <th>b</th>\n",
       "      <th>c</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>one</th>\n",
       "      <td>4</td>\n",
       "      <td>5</td>\n",
       "      <td>6</td>\n",
       "      <td>7</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>three</th>\n",
       "      <td>8</td>\n",
       "      <td>9</td>\n",
       "      <td>10</td>\n",
       "      <td>11</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>two</th>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>2</td>\n",
       "      <td>3</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "       d  a   b   c\n",
       "one    4  5   6   7\n",
       "three  8  9  10  11\n",
       "two    0  1   2   3"
      ]
     },
     "execution_count": 5,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df.sort_index()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>a</th>\n",
       "      <th>b</th>\n",
       "      <th>c</th>\n",
       "      <th>d</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>two</th>\n",
       "      <td>1</td>\n",
       "      <td>2</td>\n",
       "      <td>3</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>one</th>\n",
       "      <td>5</td>\n",
       "      <td>6</td>\n",
       "      <td>7</td>\n",
       "      <td>4</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>three</th>\n",
       "      <td>9</td>\n",
       "      <td>10</td>\n",
       "      <td>11</td>\n",
       "      <td>8</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "       a   b   c  d\n",
       "two    1   2   3  0\n",
       "one    5   6   7  4\n",
       "three  9  10  11  8"
      ]
     },
     "execution_count": 6,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df.sort_index(axis=1)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>d</th>\n",
       "      <th>c</th>\n",
       "      <th>b</th>\n",
       "      <th>a</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>two</th>\n",
       "      <td>0</td>\n",
       "      <td>3</td>\n",
       "      <td>2</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>one</th>\n",
       "      <td>4</td>\n",
       "      <td>7</td>\n",
       "      <td>6</td>\n",
       "      <td>5</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>three</th>\n",
       "      <td>8</td>\n",
       "      <td>11</td>\n",
       "      <td>10</td>\n",
       "      <td>9</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "       d   c   b  a\n",
       "two    0   3   2  1\n",
       "one    4   7   6  5\n",
       "three  8  11  10  9"
      ]
     },
     "execution_count": 7,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df.sort_index(axis=1, ascending=False)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0    5.0\n",
       "1    NaN\n",
       "2    3.0\n",
       "3   -1.0\n",
       "4    9.0\n",
       "dtype: float64"
      ]
     },
     "execution_count": 8,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "s2=pd.Series([5,np.nan,3,-1,9])\n",
    "s2"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "3   -1.0\n",
       "2    3.0\n",
       "0    5.0\n",
       "4    9.0\n",
       "1    NaN\n",
       "dtype: float64"
      ]
     },
     "execution_count": 9,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "s2.sort_values()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>a</th>\n",
       "      <th>b</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>5</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>3</td>\n",
       "      <td>-2</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>-1</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>9</td>\n",
       "      <td>5</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "   a  b\n",
       "0  5  1\n",
       "1  3 -2\n",
       "2 -1  0\n",
       "3  9  5"
      ]
     },
     "execution_count": 10,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df2=pd.DataFrame(\n",
    "    {\"a\":[5,3,-1,9],\"b\":[1,-2,0,5]})\n",
    "df2"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>a</th>\n",
       "      <th>b</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>3</td>\n",
       "      <td>-2</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>-1</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>5</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>9</td>\n",
       "      <td>5</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "   a  b\n",
       "1  3 -2\n",
       "2 -1  0\n",
       "0  5  1\n",
       "3  9  5"
      ]
     },
     "execution_count": 11,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df2.sort_values(by=\"b\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>a</th>\n",
       "      <th>b</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>3</td>\n",
       "      <td>-2</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>-1</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>5</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>9</td>\n",
       "      <td>5</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "   a  b\n",
       "1  3 -2\n",
       "2 -1  0\n",
       "0  5  1\n",
       "3  9  5"
      ]
     },
     "execution_count": 12,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df2.sort_values(by=[\"b\",\"a\"])"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Practice\n",
    "Let's practice using a real data set. You can download data set from https://www.kaggle.com/melodyxyz/global."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {},
   "outputs": [],
   "source": [
    "data=pd.read_csv(\"Data/vgsalesGlobale.csv\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Rank</th>\n",
       "      <th>Name</th>\n",
       "      <th>Platform</th>\n",
       "      <th>Year</th>\n",
       "      <th>Genre</th>\n",
       "      <th>Publisher</th>\n",
       "      <th>NA_Sales</th>\n",
       "      <th>EU_Sales</th>\n",
       "      <th>JP_Sales</th>\n",
       "      <th>Other_Sales</th>\n",
       "      <th>Global_Sales</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>1</td>\n",
       "      <td>Wii Sports</td>\n",
       "      <td>Wii</td>\n",
       "      <td>2006.0</td>\n",
       "      <td>Sports</td>\n",
       "      <td>Nintendo</td>\n",
       "      <td>41.49</td>\n",
       "      <td>29.02</td>\n",
       "      <td>3.77</td>\n",
       "      <td>8.46</td>\n",
       "      <td>82.74</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>2</td>\n",
       "      <td>Super Mario Bros.</td>\n",
       "      <td>NES</td>\n",
       "      <td>1985.0</td>\n",
       "      <td>Platform</td>\n",
       "      <td>Nintendo</td>\n",
       "      <td>29.08</td>\n",
       "      <td>3.58</td>\n",
       "      <td>6.81</td>\n",
       "      <td>0.77</td>\n",
       "      <td>40.24</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>3</td>\n",
       "      <td>Mario Kart Wii</td>\n",
       "      <td>Wii</td>\n",
       "      <td>2008.0</td>\n",
       "      <td>Racing</td>\n",
       "      <td>Nintendo</td>\n",
       "      <td>15.85</td>\n",
       "      <td>12.88</td>\n",
       "      <td>3.79</td>\n",
       "      <td>3.31</td>\n",
       "      <td>35.82</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>4</td>\n",
       "      <td>Wii Sports Resort</td>\n",
       "      <td>Wii</td>\n",
       "      <td>2009.0</td>\n",
       "      <td>Sports</td>\n",
       "      <td>Nintendo</td>\n",
       "      <td>15.75</td>\n",
       "      <td>11.01</td>\n",
       "      <td>3.28</td>\n",
       "      <td>2.96</td>\n",
       "      <td>33.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>5</td>\n",
       "      <td>Pokemon Red/Pokemon Blue</td>\n",
       "      <td>GB</td>\n",
       "      <td>1996.0</td>\n",
       "      <td>Role-Playing</td>\n",
       "      <td>Nintendo</td>\n",
       "      <td>11.27</td>\n",
       "      <td>8.89</td>\n",
       "      <td>10.22</td>\n",
       "      <td>1.00</td>\n",
       "      <td>31.37</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "   Rank                      Name Platform    Year         Genre Publisher  \\\n",
       "0     1                Wii Sports      Wii  2006.0        Sports  Nintendo   \n",
       "1     2         Super Mario Bros.      NES  1985.0      Platform  Nintendo   \n",
       "2     3            Mario Kart Wii      Wii  2008.0        Racing  Nintendo   \n",
       "3     4         Wii Sports Resort      Wii  2009.0        Sports  Nintendo   \n",
       "4     5  Pokemon Red/Pokemon Blue       GB  1996.0  Role-Playing  Nintendo   \n",
       "\n",
       "   NA_Sales  EU_Sales  JP_Sales  Other_Sales  Global_Sales  \n",
       "0     41.49     29.02      3.77         8.46         82.74  \n",
       "1     29.08      3.58      6.81         0.77         40.24  \n",
       "2     15.85     12.88      3.79         3.31         35.82  \n",
       "3     15.75     11.01      3.28         2.96         33.00  \n",
       "4     11.27      8.89     10.22         1.00         31.37  "
      ]
     },
     "execution_count": 14,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "data.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "9135                ¡Shin Chan Flipa en colores!\n",
       "470                   wwe Smackdown vs. Raw 2006\n",
       "15523               uDraw Studio: Instant Artist\n",
       "7835                uDraw Studio: Instant Artist\n",
       "627                                 uDraw Studio\n",
       "                          ...                   \n",
       "8304               .hack//G.U. Vol.3//Redemption\n",
       "8602     .hack//G.U. Vol.2//Reminisce (jp sales)\n",
       "7107                .hack//G.U. Vol.2//Reminisce\n",
       "8357                  .hack//G.U. Vol.1//Rebirth\n",
       "4754                                 '98 Koshien\n",
       "Name: Name, Length: 16598, dtype: object"
      ]
     },
     "execution_count": 15,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "data[\"Name\"].sort_values(ascending=False)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Rank</th>\n",
       "      <th>Name</th>\n",
       "      <th>Platform</th>\n",
       "      <th>Year</th>\n",
       "      <th>Genre</th>\n",
       "      <th>Publisher</th>\n",
       "      <th>NA_Sales</th>\n",
       "      <th>EU_Sales</th>\n",
       "      <th>JP_Sales</th>\n",
       "      <th>Other_Sales</th>\n",
       "      <th>Global_Sales</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>4754</th>\n",
       "      <td>4756</td>\n",
       "      <td>'98 Koshien</td>\n",
       "      <td>PS</td>\n",
       "      <td>1998.0</td>\n",
       "      <td>Sports</td>\n",
       "      <td>Magical Company</td>\n",
       "      <td>0.15</td>\n",
       "      <td>0.10</td>\n",
       "      <td>0.12</td>\n",
       "      <td>0.03</td>\n",
       "      <td>0.41</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8357</th>\n",
       "      <td>8359</td>\n",
       "      <td>.hack//G.U. Vol.1//Rebirth</td>\n",
       "      <td>PS2</td>\n",
       "      <td>2006.0</td>\n",
       "      <td>Role-Playing</td>\n",
       "      <td>Namco Bandai Games</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.17</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.17</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7107</th>\n",
       "      <td>7109</td>\n",
       "      <td>.hack//G.U. Vol.2//Reminisce</td>\n",
       "      <td>PS2</td>\n",
       "      <td>2006.0</td>\n",
       "      <td>Role-Playing</td>\n",
       "      <td>Namco Bandai Games</td>\n",
       "      <td>0.11</td>\n",
       "      <td>0.09</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.03</td>\n",
       "      <td>0.23</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8602</th>\n",
       "      <td>8604</td>\n",
       "      <td>.hack//G.U. Vol.2//Reminisce (jp sales)</td>\n",
       "      <td>PS2</td>\n",
       "      <td>2006.0</td>\n",
       "      <td>Role-Playing</td>\n",
       "      <td>Namco Bandai Games</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.16</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.16</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8304</th>\n",
       "      <td>8306</td>\n",
       "      <td>.hack//G.U. Vol.3//Redemption</td>\n",
       "      <td>PS2</td>\n",
       "      <td>2007.0</td>\n",
       "      <td>Role-Playing</td>\n",
       "      <td>Namco Bandai Games</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.17</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.17</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>627</th>\n",
       "      <td>628</td>\n",
       "      <td>uDraw Studio</td>\n",
       "      <td>Wii</td>\n",
       "      <td>2010.0</td>\n",
       "      <td>Misc</td>\n",
       "      <td>THQ</td>\n",
       "      <td>1.67</td>\n",
       "      <td>0.58</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.20</td>\n",
       "      <td>2.46</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7835</th>\n",
       "      <td>7837</td>\n",
       "      <td>uDraw Studio: Instant Artist</td>\n",
       "      <td>Wii</td>\n",
       "      <td>2011.0</td>\n",
       "      <td>Misc</td>\n",
       "      <td>THQ</td>\n",
       "      <td>0.08</td>\n",
       "      <td>0.09</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.02</td>\n",
       "      <td>0.19</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>15523</th>\n",
       "      <td>15526</td>\n",
       "      <td>uDraw Studio: Instant Artist</td>\n",
       "      <td>X360</td>\n",
       "      <td>2011.0</td>\n",
       "      <td>Misc</td>\n",
       "      <td>THQ</td>\n",
       "      <td>0.01</td>\n",
       "      <td>0.01</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.02</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>470</th>\n",
       "      <td>471</td>\n",
       "      <td>wwe Smackdown vs. Raw 2006</td>\n",
       "      <td>PS2</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Fighting</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1.57</td>\n",
       "      <td>1.02</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.41</td>\n",
       "      <td>3.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9135</th>\n",
       "      <td>9137</td>\n",
       "      <td>¡Shin Chan Flipa en colores!</td>\n",
       "      <td>DS</td>\n",
       "      <td>2007.0</td>\n",
       "      <td>Platform</td>\n",
       "      <td>505 Games</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.14</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.14</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>16598 rows × 11 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "        Rank                                     Name Platform    Year  \\\n",
       "4754    4756                              '98 Koshien       PS  1998.0   \n",
       "8357    8359               .hack//G.U. Vol.1//Rebirth      PS2  2006.0   \n",
       "7107    7109             .hack//G.U. Vol.2//Reminisce      PS2  2006.0   \n",
       "8602    8604  .hack//G.U. Vol.2//Reminisce (jp sales)      PS2  2006.0   \n",
       "8304    8306            .hack//G.U. Vol.3//Redemption      PS2  2007.0   \n",
       "...      ...                                      ...      ...     ...   \n",
       "627      628                             uDraw Studio      Wii  2010.0   \n",
       "7835    7837             uDraw Studio: Instant Artist      Wii  2011.0   \n",
       "15523  15526             uDraw Studio: Instant Artist     X360  2011.0   \n",
       "470      471               wwe Smackdown vs. Raw 2006      PS2     NaN   \n",
       "9135    9137             ¡Shin Chan Flipa en colores!       DS  2007.0   \n",
       "\n",
       "              Genre           Publisher  NA_Sales  EU_Sales  JP_Sales  \\\n",
       "4754         Sports     Magical Company      0.15      0.10      0.12   \n",
       "8357   Role-Playing  Namco Bandai Games      0.00      0.00      0.17   \n",
       "7107   Role-Playing  Namco Bandai Games      0.11      0.09      0.00   \n",
       "8602   Role-Playing  Namco Bandai Games      0.00      0.00      0.16   \n",
       "8304   Role-Playing  Namco Bandai Games      0.00      0.00      0.17   \n",
       "...             ...                 ...       ...       ...       ...   \n",
       "627            Misc                 THQ      1.67      0.58      0.00   \n",
       "7835           Misc                 THQ      0.08      0.09      0.00   \n",
       "15523          Misc                 THQ      0.01      0.01      0.00   \n",
       "470        Fighting                 NaN      1.57      1.02      0.00   \n",
       "9135       Platform           505 Games      0.00      0.00      0.14   \n",
       "\n",
       "       Other_Sales  Global_Sales  \n",
       "4754          0.03          0.41  \n",
       "8357          0.00          0.17  \n",
       "7107          0.03          0.23  \n",
       "8602          0.00          0.16  \n",
       "8304          0.00          0.17  \n",
       "...            ...           ...  \n",
       "627           0.20          2.46  \n",
       "7835          0.02          0.19  \n",
       "15523         0.00          0.02  \n",
       "470           0.41          3.00  \n",
       "9135          0.00          0.14  \n",
       "\n",
       "[16598 rows x 11 columns]"
      ]
     },
     "execution_count": 16,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "data.sort_values(\"Name\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Rank</th>\n",
       "      <th>Name</th>\n",
       "      <th>Platform</th>\n",
       "      <th>Year</th>\n",
       "      <th>Genre</th>\n",
       "      <th>Publisher</th>\n",
       "      <th>NA_Sales</th>\n",
       "      <th>EU_Sales</th>\n",
       "      <th>JP_Sales</th>\n",
       "      <th>Other_Sales</th>\n",
       "      <th>Global_Sales</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>6896</th>\n",
       "      <td>6898</td>\n",
       "      <td>Checkers</td>\n",
       "      <td>2600</td>\n",
       "      <td>1980.0</td>\n",
       "      <td>Misc</td>\n",
       "      <td>Atari</td>\n",
       "      <td>0.22</td>\n",
       "      <td>0.01</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.24</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2669</th>\n",
       "      <td>2671</td>\n",
       "      <td>Boxing</td>\n",
       "      <td>2600</td>\n",
       "      <td>1980.0</td>\n",
       "      <td>Fighting</td>\n",
       "      <td>Activision</td>\n",
       "      <td>0.72</td>\n",
       "      <td>0.04</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.01</td>\n",
       "      <td>0.77</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5366</th>\n",
       "      <td>5368</td>\n",
       "      <td>Freeway</td>\n",
       "      <td>2600</td>\n",
       "      <td>1980.0</td>\n",
       "      <td>Action</td>\n",
       "      <td>Activision</td>\n",
       "      <td>0.32</td>\n",
       "      <td>0.02</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.34</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1969</th>\n",
       "      <td>1971</td>\n",
       "      <td>Defender</td>\n",
       "      <td>2600</td>\n",
       "      <td>1980.0</td>\n",
       "      <td>Misc</td>\n",
       "      <td>Atari</td>\n",
       "      <td>0.99</td>\n",
       "      <td>0.05</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.01</td>\n",
       "      <td>1.05</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1766</th>\n",
       "      <td>1768</td>\n",
       "      <td>Kaboom!</td>\n",
       "      <td>2600</td>\n",
       "      <td>1980.0</td>\n",
       "      <td>Misc</td>\n",
       "      <td>Activision</td>\n",
       "      <td>1.07</td>\n",
       "      <td>0.07</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.01</td>\n",
       "      <td>1.15</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>16307</th>\n",
       "      <td>16310</td>\n",
       "      <td>Freaky Flyers</td>\n",
       "      <td>GC</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Racing</td>\n",
       "      <td>Unknown</td>\n",
       "      <td>0.01</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.01</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>16327</th>\n",
       "      <td>16330</td>\n",
       "      <td>Inversion</td>\n",
       "      <td>PC</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Shooter</td>\n",
       "      <td>Namco Bandai Games</td>\n",
       "      <td>0.01</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.01</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>16366</th>\n",
       "      <td>16369</td>\n",
       "      <td>Hakuouki: Shinsengumi Kitan</td>\n",
       "      <td>PS3</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Adventure</td>\n",
       "      <td>Unknown</td>\n",
       "      <td>0.01</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.01</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>16427</th>\n",
       "      <td>16430</td>\n",
       "      <td>Virtua Quest</td>\n",
       "      <td>GC</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Role-Playing</td>\n",
       "      <td>Unknown</td>\n",
       "      <td>0.01</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.01</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>16493</th>\n",
       "      <td>16496</td>\n",
       "      <td>The Smurfs</td>\n",
       "      <td>3DS</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Action</td>\n",
       "      <td>Unknown</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.01</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.01</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>16598 rows × 11 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "        Rank                         Name Platform    Year         Genre  \\\n",
       "6896    6898                     Checkers     2600  1980.0          Misc   \n",
       "2669    2671                       Boxing     2600  1980.0      Fighting   \n",
       "5366    5368                      Freeway     2600  1980.0        Action   \n",
       "1969    1971                     Defender     2600  1980.0          Misc   \n",
       "1766    1768                      Kaboom!     2600  1980.0          Misc   \n",
       "...      ...                          ...      ...     ...           ...   \n",
       "16307  16310                Freaky Flyers       GC     NaN        Racing   \n",
       "16327  16330                    Inversion       PC     NaN       Shooter   \n",
       "16366  16369  Hakuouki: Shinsengumi Kitan      PS3     NaN     Adventure   \n",
       "16427  16430                 Virtua Quest       GC     NaN  Role-Playing   \n",
       "16493  16496                   The Smurfs      3DS     NaN        Action   \n",
       "\n",
       "                Publisher  NA_Sales  EU_Sales  JP_Sales  Other_Sales  \\\n",
       "6896                Atari      0.22      0.01       0.0         0.00   \n",
       "2669           Activision      0.72      0.04       0.0         0.01   \n",
       "5366           Activision      0.32      0.02       0.0         0.00   \n",
       "1969                Atari      0.99      0.05       0.0         0.01   \n",
       "1766           Activision      1.07      0.07       0.0         0.01   \n",
       "...                   ...       ...       ...       ...          ...   \n",
       "16307             Unknown      0.01      0.00       0.0         0.00   \n",
       "16327  Namco Bandai Games      0.01      0.00       0.0         0.00   \n",
       "16366             Unknown      0.01      0.00       0.0         0.00   \n",
       "16427             Unknown      0.01      0.00       0.0         0.00   \n",
       "16493             Unknown      0.00      0.01       0.0         0.00   \n",
       "\n",
       "       Global_Sales  \n",
       "6896           0.24  \n",
       "2669           0.77  \n",
       "5366           0.34  \n",
       "1969           1.05  \n",
       "1766           1.15  \n",
       "...             ...  \n",
       "16307          0.01  \n",
       "16327          0.01  \n",
       "16366          0.01  \n",
       "16427          0.01  \n",
       "16493          0.01  \n",
       "\n",
       "[16598 rows x 11 columns]"
      ]
     },
     "execution_count": 17,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "data.sort_values(\"Year\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Rank</th>\n",
       "      <th>Name</th>\n",
       "      <th>Platform</th>\n",
       "      <th>Year</th>\n",
       "      <th>Genre</th>\n",
       "      <th>Publisher</th>\n",
       "      <th>NA_Sales</th>\n",
       "      <th>EU_Sales</th>\n",
       "      <th>JP_Sales</th>\n",
       "      <th>Other_Sales</th>\n",
       "      <th>Global_Sales</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>258</th>\n",
       "      <td>259</td>\n",
       "      <td>Asteroids</td>\n",
       "      <td>2600</td>\n",
       "      <td>1980.0</td>\n",
       "      <td>Shooter</td>\n",
       "      <td>Atari</td>\n",
       "      <td>4.00</td>\n",
       "      <td>0.26</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.05</td>\n",
       "      <td>4.31</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2669</th>\n",
       "      <td>2671</td>\n",
       "      <td>Boxing</td>\n",
       "      <td>2600</td>\n",
       "      <td>1980.0</td>\n",
       "      <td>Fighting</td>\n",
       "      <td>Activision</td>\n",
       "      <td>0.72</td>\n",
       "      <td>0.04</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.01</td>\n",
       "      <td>0.77</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6317</th>\n",
       "      <td>6319</td>\n",
       "      <td>Bridge</td>\n",
       "      <td>2600</td>\n",
       "      <td>1980.0</td>\n",
       "      <td>Misc</td>\n",
       "      <td>Activision</td>\n",
       "      <td>0.25</td>\n",
       "      <td>0.02</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.27</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6896</th>\n",
       "      <td>6898</td>\n",
       "      <td>Checkers</td>\n",
       "      <td>2600</td>\n",
       "      <td>1980.0</td>\n",
       "      <td>Misc</td>\n",
       "      <td>Atari</td>\n",
       "      <td>0.22</td>\n",
       "      <td>0.01</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.24</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1969</th>\n",
       "      <td>1971</td>\n",
       "      <td>Defender</td>\n",
       "      <td>2600</td>\n",
       "      <td>1980.0</td>\n",
       "      <td>Misc</td>\n",
       "      <td>Atari</td>\n",
       "      <td>0.99</td>\n",
       "      <td>0.05</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.01</td>\n",
       "      <td>1.05</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7351</th>\n",
       "      <td>7353</td>\n",
       "      <td>Yu Yu Hakusho: Dark Tournament</td>\n",
       "      <td>PS2</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Fighting</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.10</td>\n",
       "      <td>0.08</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.03</td>\n",
       "      <td>0.21</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>15476</th>\n",
       "      <td>15479</td>\n",
       "      <td>Yu-Gi-Oh! 5D's Wheelie Breakers (JP sales)</td>\n",
       "      <td>Wii</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Racing</td>\n",
       "      <td>Unknown</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.02</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.02</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>11409</th>\n",
       "      <td>11411</td>\n",
       "      <td>Zero: Tsukihami no Kamen</td>\n",
       "      <td>Wii</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Action</td>\n",
       "      <td>Nintendo</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.08</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.08</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8899</th>\n",
       "      <td>8901</td>\n",
       "      <td>eJay Clubworld</td>\n",
       "      <td>PS2</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Misc</td>\n",
       "      <td>Empire Interactive</td>\n",
       "      <td>0.07</td>\n",
       "      <td>0.06</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.02</td>\n",
       "      <td>0.15</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>470</th>\n",
       "      <td>471</td>\n",
       "      <td>wwe Smackdown vs. Raw 2006</td>\n",
       "      <td>PS2</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Fighting</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1.57</td>\n",
       "      <td>1.02</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.41</td>\n",
       "      <td>3.00</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>16598 rows × 11 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "        Rank                                        Name Platform    Year  \\\n",
       "258      259                                   Asteroids     2600  1980.0   \n",
       "2669    2671                                      Boxing     2600  1980.0   \n",
       "6317    6319                                      Bridge     2600  1980.0   \n",
       "6896    6898                                    Checkers     2600  1980.0   \n",
       "1969    1971                                    Defender     2600  1980.0   \n",
       "...      ...                                         ...      ...     ...   \n",
       "7351    7353              Yu Yu Hakusho: Dark Tournament      PS2     NaN   \n",
       "15476  15479  Yu-Gi-Oh! 5D's Wheelie Breakers (JP sales)      Wii     NaN   \n",
       "11409  11411                    Zero: Tsukihami no Kamen      Wii     NaN   \n",
       "8899    8901                              eJay Clubworld      PS2     NaN   \n",
       "470      471                  wwe Smackdown vs. Raw 2006      PS2     NaN   \n",
       "\n",
       "          Genre           Publisher  NA_Sales  EU_Sales  JP_Sales  \\\n",
       "258     Shooter               Atari      4.00      0.26      0.00   \n",
       "2669   Fighting          Activision      0.72      0.04      0.00   \n",
       "6317       Misc          Activision      0.25      0.02      0.00   \n",
       "6896       Misc               Atari      0.22      0.01      0.00   \n",
       "1969       Misc               Atari      0.99      0.05      0.00   \n",
       "...         ...                 ...       ...       ...       ...   \n",
       "7351   Fighting                 NaN      0.10      0.08      0.00   \n",
       "15476    Racing             Unknown      0.00      0.00      0.02   \n",
       "11409    Action            Nintendo      0.00      0.00      0.08   \n",
       "8899       Misc  Empire Interactive      0.07      0.06      0.00   \n",
       "470    Fighting                 NaN      1.57      1.02      0.00   \n",
       "\n",
       "       Other_Sales  Global_Sales  \n",
       "258           0.05          4.31  \n",
       "2669          0.01          0.77  \n",
       "6317          0.00          0.27  \n",
       "6896          0.00          0.24  \n",
       "1969          0.01          1.05  \n",
       "...            ...           ...  \n",
       "7351          0.03          0.21  \n",
       "15476         0.00          0.02  \n",
       "11409         0.00          0.08  \n",
       "8899          0.02          0.15  \n",
       "470           0.41          3.00  \n",
       "\n",
       "[16598 rows x 11 columns]"
      ]
     },
     "execution_count": 18,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "data.sort_values([\"Year\",\"Name\"])"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Don't forget to follow us on [YouTube](http://youtube.com/tirendazacademy) | [Medium](http://tirendazacademy.medium.com) | [Twitter](http://twitter.com/tirendazacademy) | [GitHub](http://github.com/tirendazacademy) | [Linkedin](https://www.linkedin.com/in/tirendaz-academy) | [Kaggle](https://www.kaggle.com/tirendazacademy) 😎"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.8.12"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
